package com.j283_5.wisdom_park.controller.car_management;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.CarInformation;
import com.j283_5.wisdom_park.pojo.Visitors;
import com.j283_5.wisdom_park.vo.car_management.CarInformationVo;
import com.j283_5.wisdom_park.vo.visitor_management.UserIoVo;
import com.j283_5.wisdom_park.vo.visitor_management.VisitorsInfoVo;
import com.j283_5.wisdom_park.vo.visitor_management.VisitorsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 蒋翔
 * @since 2022-04-29
 */
@RestController
@RequestMapping("/car")
@Api(value = "车辆信息管理",tags = "车辆信息管理",produces="蒋翔")
public class CarController {
    @RequestMapping(value = "/carInformationList" , method = RequestMethod.GET)
    @ApiOperation(value = "查询所有车辆信息",notes = "查询所有车辆信息（分页）",produces="蒋翔", response = ResultData.class)
    public ResultData carInformationList(@Param("page") Page<Visitors> page, @Param("carInformation") CarInformation carInformation){
        List<CarInformationVo> carInformationVoList = new ArrayList<>();
        CarInformationVo carInformationVo1 = new CarInformationVo(1, "张勋", "18767256412", "豫A00FX2", "丰田2020款 2.5L 无级 尊贵版", "" +
                "包月车", new Timestamp(System.currentTimeMillis()), new Timestamp(System.currentTimeMillis()));
        CarInformationVo carInformationVo2 = new CarInformationVo(2, "李君虞", "13208432854", "浙A88888", "阿斯顿·马丁2012款 6.0L 手自一体", "" +
                "临时车");
        carInformationVoList.add(carInformationVo1);
        carInformationVoList.add(carInformationVo2);
        return ResultData.ok().data(carInformationVoList);
    }

    @RequestMapping(value = "/findOneVisitors/{cinfId}" , method = RequestMethod.POST)
    @ApiOperation(value = "访客信息详情",notes = "查询访客信息详情",produces="蒋翔", response = ResultData.class)
    public ResultData findOneVisitors(@PathParam("cinfId") Integer cinfId){

        return ResultData.ok();
    }
}

